Skip to content

txframe blobify and persist#4220

Merged
advaita-saha merged 29 commits into
masterfrom
txFrame-persist
May 22, 2026
Merged

txframe blobify and persist#4220
advaita-saha merged 29 commits into
masterfrom
txFrame-persist

Conversation

@advaita-saha
Copy link
Copy Markdown
Contributor

@advaita-saha advaita-saha commented May 7, 2026

Opens up interface for us to persist txFrame into the database, so that we don't need to re-process the blocks again. Further it will be used to extend the DAG implementation
For now reduces the overhead for FcState, i.e fixes #3244

Size Estimates

For a typical Ethereum mainnet block (~200 transactions):

Component Typical entries Bytes/entry Subtotal
sTab — branch nodes ~1000 ~80 ~80 KB
sTab — leaf nodes (acc + sto) ~100 ~115 ~172 KB
accLeaves cache ~500 ~87 ~43 KB
stoLeaves cache ~1000 ~71 ~71 KB
KVT sTab (txs, receipts, code) ~400–600 ~500 avg ~200 KB
Length prefixes and rvid headers ~10 KB
Total ~576 KB

Practical range:

  • Empty block: < 5 KB
  • Average mainnet block: 500–700 KB
  • Dense DeFi block: 1–3 MB

A cache window of 64 recent frames requires roughly 40 MB total KVT storage.

Comment thread execution_chain/db/storage_types.nim Outdated
Comment thread execution_chain/db/tx_frame_db.nim Outdated
Comment thread execution_chain/db/aristo/aristo_tx_blobify.nim Outdated
Comment thread execution_chain/db/aristo/aristo_tx_blobify.nim Outdated
Comment thread execution_chain/db/aristo/aristo_tx_blobify.nim Outdated
Comment thread execution_chain/db/aristo/aristo_tx_blobify.nim Outdated
Comment thread execution_chain/db/aristo/aristo_tx_blobify.nim
Comment thread execution_chain/db/tx_frame_db.nim Outdated
@tersec
Copy link
Copy Markdown
Contributor

tersec commented May 8, 2026

Is this diff cache pruned somewhere when base updates?

@advaita-saha
Copy link
Copy Markdown
Contributor Author

Is this diff cache pruned somewhere when base updates?

Not yet, but will
Logic would be to prune when we load the fcState

…int detour)

blob.len widened to uint64 for the bounds comparisons
aLen + 4 + 4 and kOff + 4 + kLen can't overflow uint64
int(...) only at the final blob.toOpenArray indexing — and by then the bounds check has guaranteed the value fits in int (since it's at most blob.len, itself an int)
@advaita-saha advaita-saha requested a review from tersec May 12, 2026 10:03
@advaita-saha advaita-saha marked this pull request as ready for review May 21, 2026 13:45
@advaita-saha advaita-saha merged commit 53482b4 into master May 22, 2026
24 checks passed
@advaita-saha advaita-saha deleted the txFrame-persist branch May 22, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Huge FC.deserialize ( 2+ hours ) time for long non-finality / LC sync

2 participants